//用户登录成功 存储 token 和用户的基本信息 （姓名 头像 手机号）
import { createSlice } from "@reduxjs/toolkit";

export const userSlice = createSlice({
  name: "user",
  initialState: {
    info: null, //NAN undefined '' 0  转换成 false
  },
  reducers: {
    setInfo: (state, action) => {
      state.info = action.payload;
    },
  },
});
// 每个 case reducer 函数会生成对应的 Action creators
export const { setInfo } = userSlice.actions;

export default userSlice.reducer;
